package bb.lanxing;

import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.action.ViewActions.click;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static androidx.test.espresso.matcher.ViewMatchers.withText;

import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;

import bb.lanxing.test.SimpleViewActivity;

@RunWith(AndroidJUnit4.class)
public class SimpleViewTest {

    @Rule
    public ActivityTestRule<SimpleViewActivity> mActivityRule=new ActivityTestRule<>(SimpleViewActivity.class);
    @Test
    public void textViewTest() throws Exception {
        onView(withId(R.id.tv_key))
                .check(matches(withText("吃饭时间:")));
    }

    @Test
    public void buttonTest() throws Exception {
        onView(withId(R.id.btn_setting))
                .check(matches(withText("设置吃饭时间")))
                .perform(click());
        //onView(withId(R.id.tv_value))
        //        .check(matches(withText("777")));
    }
}
